﻿CREATE TABLE [dbo].[Pacienti] (
    [IDPacient]    INT           IDENTITY (1, 1) NOT NULL,
    [Nume_Prenume] VARCHAR (150) NOT NULL,
    [Sex]          SMALLINT      CONSTRAINT [DF_Pacienti_Sex] DEFAULT ((0)) NOT NULL,
    [DataNasterii] DATETIME      CONSTRAINT [DF_Pacienti_DataNasterii] DEFAULT (getdate()) NOT NULL,
    [Inaltime]     FLOAT (53)    CONSTRAINT [DF_Pacienti_Inaltime] DEFAULT ((0)) NOT NULL,
    [CodUnitate]   SMALLINT      CONSTRAINT [DF_Pacienti_CodUnitate] DEFAULT ((0)) NOT NULL,
    CONSTRAINT [PK_Pacienti] PRIMARY KEY CLUSTERED ([IDPacient] ASC),
    CONSTRAINT [FK_Pacienti_Unitati] FOREIGN KEY ([CodUnitate]) REFERENCES [dbo].[Unitati] ([CodUnitate])
);


GO
CREATE NONCLUSTERED INDEX [IX_Pacienti]
    ON [dbo].[Pacienti]([Nume_Prenume] ASC);

